package com.jpro.framework.quartz.client.constant;


/**
 * @author xuxueli 2020-10-29 21:11:23
 */
public enum ScheduleTypeEnum {
    /**
     * 认为类型 NONE
     */
    NONE("schedule_type_none"),

    /**
     * schedule by cron
     */
    CRON("schedule_type_cron"),

    /**
     * schedule by fixed rate (in seconds)
     */
    FIX_RATE("schedule_type_fix_rate"),

    /**
     * schedule by fix delay (in seconds)， after the last time
     */
    /*FIX_DELAY(I18nUtil.getString("schedule_type_fix_delay"))*/;

    private String title;

    ScheduleTypeEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public static ScheduleTypeEnum match(String name, ScheduleTypeEnum defaultItem) {
        for (ScheduleTypeEnum item : ScheduleTypeEnum.values()) {
            if (item.name().equals(name)) {
                return item;
            }
        }
        return defaultItem;
    }

}
